<?php
session_start();require('../conn.php');require('../functions.php');require('admin.php');$page=$_GET['page'];if(is_numeric($page)==false){$page=1;$page_1=1;$min=0;$page_2=$page+1;}else{if($page>1){$page_2=$page+1;$min=($page-1)*35;$page_1=$page-1;}else{$page_1=1;$min=0;$page_2=2;}}$max=$page*30;$rows=$mysql->query("select * from `tongjidata` order by `day` desc limit {$min},{$max}");?>

<?php include('head.php')?>    

    <div class="container-fluid">
        
        <div class="row-fluid">
		<?php
 include('left.php');?>
<div class="span9">
            <h1 class="page-title">日段统计</h1>

<div class="well">
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
		<div class="well">
<div class="pull-right">
<a href="tongjilist.php" class="btn">首页</a></button>
<a href="tongjilist.php?page=<?php echo $page_1?>" class="btn" style="margin-left:5px;">上一页</a>
<a href="tongjilist.php?page=<?php echo $page_2?>" class="btn" style="margin-left:5px;">下一页</a>
</div>
    <table class="table">
      <thead>
        <tr>
          <th>日期</th>
		  <th>IP阅读数</th>
        </tr>
      </thead>
      <tbody>
<?php
 foreach($rows as $row){$htmlday=$row['day'];if($row['day']==date("Y-m-d",time())){$htmlday=$row['day'].' (今天)';}if(date('w',strtotime($row['day']))==6){$htmlday=$row['day'].' (星期六)';}if(date('w',strtotime($row['day']))==0){$htmlday=$row['day'].' (星期日)';}print <<<table
        <tr>
          <td>{$htmlday}</td>
		  <td>{$row['ip']}</td>
        </tr>
table;
}?>  
      </tbody>
    </table>
</div>
      </div>
      <div class="tab-pane fade" id="profile">
      </div>
  </div>

</div>

        </div>
    </div>
    </div>

    
    <footer>
        <hr>
        
        <p class="pull-right"><!--power by right--></p>
        
        
        <p><!--power by --></p>
    </footer>
    

    

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="lib/bootstrap/js/bootstrap.js"></script>
	<script language="JavaScript">             
	function del_id(id){
		if(confirm("删除是不可恢复的，你确认要删除吗？")){
			location.href="?del_id="+id;
			
		}else{
			return false;
		}
	}
	</script>	


  </body>
</html>